import os


class Upload:
    """mumu模拟器上传图片至相机，并提供相册刷新，上传路径：/storage/emulated/0/xzbYSP/netupload/"""

    def __init__(self, opt):
        self.opt = opt

    def upload(self, filePath):
        # mumu模拟器
        os.system(f"adb push {filePath}  /storage/emulated/0/xzbYSP/netupload/")

    def refresh_photo(self):
        self.opt.home(1)
        self.opt.click_resource('com.mumu.launcher:id/preview_background', 1, "点击桌面分组")
        self.opt.click_text( '图库', 1, "点击图库")
        self.opt.click_bounds(1216, 96, 1440, 288, 1, "打开右上角更多")
        self.opt.click_bounds(688, 727, 1344, 824, 1, "点击刷新")
        self.opt.home(1)
